import axios from 'axios';
import { getToken, removeToken, setToken } from './token';
import router from '@/router';

const request = axios.create({
    baseURL: '',
    timeout: 5000,
});

// 添加请求拦截器
request.interceptors.request.use(config => {
    config.headers.Authorization = `Bearer ${getToken()}`;
    return config;
});

export default request;
